<?php
ob_start();
include("config.php");
//include("header.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Name       : GentleBreeze
Description: A two-column, fixed-width design with dark color scheme.
Version    : 1.0
Released   : 20120125

-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>GentleBreeze by Free CSS Templates</title>
<link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Arvo' rel='stylesheet' type='text/css'>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="wrapper">
	<div id="header-wrapper">
		<div id="header">
			<div id="logo">
				<h1>Workshop management system</h1>
				<p>&nbsp;</p>
			</div>
		</div>
	</div>
	<!-- end #header -->
	<div id="menu-wrapper">
		<div id="menu">
			<ul>
				<li class="current_page_item"><a href="index.php">Home</a></li>
				<li></li>
				<li></li>
				<li></li>
		    <li></li>
				<li></li>
			</ul>
		</div>
	</div>
	<!-- end #menu -->
	<div id="page">
		<div id="page-bgtop">
			<div id="page-bgbtm">
				<div id="page-content">
					<div id="content">
					  <div class="post">
						<h2 class="title"><a href="#">
<form method="post" action="code/validateuser.php" >
<table width="100" cellspacing="0" cellpadding="0">
  <tr>
    <td>Name</td>
    <td><input type="text" name="username" size="30"></td>
  </tr>
  <tr>
    <td>Password</td>
    <td><input type="password"	name="password" size="30"></td>
  </tr>
  <tr>
    <td></td>
    <td><input type="submit" value="login"></td>
  </tr>
</table>
</form>

<?php
if($_GET['action']=="login")
{
	echo $name=$_POST['name'];
	echo $password=$_POST['password'];
	
	$q=mysql_query("SELECT * FROM users WHERE name='".$name."' ") or die(mysql_error());
	if(mysql_num_rows($q))
	{
		$row=mysql_fetch_array($q);
		$db_password=$row['PASSWORD'];
		if($password==$db_password)
		{
			echo "welcome php";
			session_start();
			$_SESSION['user']=$name;
			$_SESSION['userid']=$row['ID'];
			header("location:workshop_manage_system.php");
			exit;
			
			}
			else 
			{
			echo "Your Password is worng";	
			}
		
		}
	else 
	{
		 echo "Name is not found";
		 }
	
}
include("fooder.php");
	
?>